import { EGameLev } from "./index";

interface IDict {
  lable: string | number | null;
  value: any;
}

/** 游戏难度 */
export const E_GAMELEV_DICT: Array<IDict> = [
  { lable: "简单", value: EGameLev.SIMPLE },
  { lable: "普通", value: EGameLev.NORMAL },
  { lable: "困难", value: EGameLev.HARD },
];


/** 字典转换 */
export function transformDict(dict: Array<IDict>, value: any) {
  const res = dict.find((item) => item.value == value);
  return res?.lable || "";
}
